#include <stdio.h>
#include <uf.h>
#include <uf_modl.h>
#include <uf_object_types.h>
#include <uf_obj.h>
#include <uf_part.h>
#include <uf_defs.h>
#include <uf_ui.h>
#define UF_CALL(X) (report( __FILE__, __LINE__, #X, (X)))

static int report( char *file, int line, char *call, int irc)
{
    if (irc)
    {
        char    messg[133];
        printf("%s, line %d:  %s\n", file, line, call);
        (UF_get_fail_message(irc, messg)) ?
            printf("    returned a %d\n", irc) :
		printf("    returned error %d:  %s\n", irc, messg);
    }
    return(irc);
}

void ufusr(char *param, int *returnCode, int rlen)
{
	int errorCode=UF_initialize();
	if(0==errorCode)
	{
		UF_FEATURE_SIGN sign = UF_NULLSIGN;
		char *block_len[3] = {"1","2","3"};
		double block_orig[3] = {0.0,0.0,0.0};
		tag_t blk_obj;
        int number_of_exps=0,i;
		char *size[3];
		UF_UI_open_listing_window();
		UF_CALL(UF_MODL_create_block1(sign, block_orig, block_len, &blk_obj));
		
		UF_MODL_ask_block_parms(blk_obj,1,size);
		for(i=0;i<3;i++)
		{
			UF_UI_write_listing_window(size[i]);
            UF_UI_write_listing_window("\n");
		}
		errorCode=UF_terminate();
	}
}